package com.squirrel.michale;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/2/25 7:59 AM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class LeetCode2348 {

    public long zeroFilledSubarray(int[] nums) {

        long count = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == 0) {
                count++;
            }


        }

        return count;


    }


    public long zeroFilledSubarray2(int[] nums) {
        var ans = 0L;
        var c = 0;
        for (var num : nums)
            if (num != 0) c = 0;
            else ans += ++c;
        return ans;
    }

}
